<?php

class Biaya extends Controller {

	function __construct()
	{
		parent::Controller();
		$this->load->helper('bantuan_helper');
		$this->load->model('Bank_model');
		if(!$this->session->userdata('user_id') && !$this->session->userdata('user_display_name') ):
			redirect('backend');
		endif;

	}

	function index()
	{
	
		$qr = $this->db->query('
		SELECT option_ID,option_name,option_value
		FROM tb_option 
		WHERE option_ID IN (15,16)
		');
		
		$data['arr_op'] = $qr->result_array();
		$data['title'] = 'Biaya';
		$data['template'] = 'biaya';
		$this->load->view('backend/index',$data);
	}
	
	function save()
	{
		$this->form_validation->set_rules('value', 'Value','required');
		if ($this->form_validation->run() == FALSE)
		{
			redirect('backend/biaya');
		}
		else
		{
			$data = array(
               'option_value' => $this->input->post('value')
            );
			$this->db->where('option_ID', $this->input->post('op_id'));
			$this->db->update('tb_option', $data); 
			
			redirect('backend/biaya');
	
		}
	
	}

}